package com.sam.im.heiqun.uis.activities;

import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.sam.im.heiqun.R;
import com.sam.im.heiqun.entities.GroupEntivity;
import com.sam.im.heiqun.uis.adapters.SectionalizationManagerAdpter;
import com.yuyh.library.uis.activitys.BaseSwipeBackActivity;
import com.yuyh.library.utils.DividerItemDecorationUtils;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import butterknife.OnClick;

/**
 * 分组管理
 */
public class SectionalizationManagerActivity extends BaseSwipeBackActivity {

    @BindView(R.id.pre_v_back)
    ImageView preVBack;
    @BindView(R.id.pre_tv_title)
    TextView preTvTitle;
    @BindView(R.id.right)
    ImageView right;
    @BindView(R.id.add_sectionalization)
    LinearLayout addSectionalization;
    @BindView(R.id.group_list)
    RecyclerView groupList;
    private SectionalizationManagerAdpter mSectionalizationManagerAdpter;

    @Override
    public int getContentViewId() {
        return R.layout.activity_sectionalization_manager;
    }

    @Override
    protected String getTitleText() {
        return getResources().getString(R.string.grouping_manage);
    }

    @Override
    protected void initViews(Bundle savedInstanceState) {

        mSectionalizationManagerAdpter = new SectionalizationManagerAdpter(this);
        groupList.setLayoutManager(new LinearLayoutManager(this));
        groupList.addItemDecoration(new DividerItemDecorationUtils(this,LinearLayoutManager.HORIZONTAL,1,getResources().getColor(R.color.black_divider)));
        groupList.setAdapter(mSectionalizationManagerAdpter);
        List<GroupEntivity> groupEntivities = new ArrayList<>();
        groupEntivities.add(new GroupEntivity());
        groupEntivities.add(new GroupEntivity());
        groupEntivities.add(new GroupEntivity());
        groupEntivities.add(new GroupEntivity());
        mSectionalizationManagerAdpter.refresh(groupEntivities);

    }

    @OnClick({R.id.pre_v_back, R.id.add_sectionalization})
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.pre_v_back:
                scrollToFinishActivity();
                break;
            case R.id.add_sectionalization:
                break;
        }
    }
}
